package com.yunshang.shoppingmall.service;

import com.yunshang.shoppingmall.entity.Cart;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

import static org.springframework.transaction.annotation.Propagation.REQUIRED;

public interface CartService {
    int deleteByPrimaryKey(Integer shoppingId);

    int insert(Cart record);
    @Transactional
    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer shoppingId);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);
    int updateLogByOrderNoAndNumber(@Param("logisticalNo") String logisticalNo, @Param("orderList") List<String> orderList,@Param("productCount") String productCount);
//    @Transactional
    int updateLogByOrderNo(@Param("logisticalNo") String logisticalNo, @Param("orderList") List<String> orderList);
//    @Transactional(propagation = REQUIRED)
    int updateLogType(@Param("logisticsType") Integer logisticsType, @Param("orderNo") String orderNo,@Param("addressId") Integer addressId);
    List<Cart> selectProductByIds(String ids);

    int upCartStatus(@Param("ids") List<String> ids,@Param("orderNo") String orderNo);

    List<Cart> selectList(String orderNo);
    List<Cart> selectByOrderNo(String orderNo);
    Cart selectCart(@Param("productId") Integer productId, @Param("guigeId") Integer guigeId,@Param("userId") Integer userId);

    /*根据用户id 查询购物车的商品数量*/
   int  selectCartProListByUserId(@Param("userId") int userId);
}
